/**
* 平台基本类
* 最基本 属性 的 定义
*/
Yacon.widget.WinControl = function()
{
	
	this.fieldName     = "";
	this.zindex   	   = 100;
	this.width         = 0;
	this.height        = 0;
	this.left          = 0;
	this.top           = 0;
		
};

Yacon.widget.WinControl.Extend(Yacon.Component,{
	
	
	create:function(elementID)
	{
		
	},
	
	/* 设置宽度 */
	setWidth:function(width){
		this.width = width;
	},
	
	/* 设置高度 */
	setHeight:function(height){
		this.height = height;
	},
	
	/**
	 * 对象字段名称
	 */
	setFieldName:function(fieldName)
	{
		this.fieldName = fieldName;
	},
	/**
	 * 获取对象字段名称
	 */
	getFieldName:function()
	{
		if (!this.fieldName)
			this.fieldName ="";
		
		return this.fieldName;
	},
	
	add:function(child,parent)
	{
		if(Yacon.isObject(child))
		{
			if (parent)
				parent.appendChild(child.element);
			else
				this.body.appendChild(child.element);
		}else if(Yacon.isElement(child))
		{
			if (parent)
				parent.appendChild(child);
			else
				this.body.appendChild(child);
		}			
	},
    remove:function(child,parent)
	{
		if(Yacon.isObject(child))
		{
			if (parent)
				parent.removeChild(child.element);
			else
				this.body.removeChild(child.element);
		}else if(Yacon.isElement(child))
		{
			if (parent)
				parent.removeChild(child);
			else
				this.body.removeChild(child);
		}			
	},
	
	/* 添加子对象 */
	addElement:function(childElement){
		if(childElement.element){
			this.element.appendChild(childElement.element);
		}else{
			this.element.appendChild(childElement);
		}	
	},
	
	/* 移除子对象 */
	removeElement:function(childElement){
		if(childElement.element){
			this.element.removeChild(childElement.element);
		}else{
			this.element.removeChild(childElement);
		}		
	}
	
});

